package org.example.javachatroom.model;

import java.util.Objects;

public class AddFriendRequest {
    /**
     * 数据类型
     */
    private String type;
    /**
     * 请求是谁发的
     */
    private int fromUserId;
    /**
     * 发请求的用户名
     */
    private String fromUserName;
    /**
     * 添加好友的原因
     */
    private String reason;

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        AddFriendRequest that = (AddFriendRequest) object;
        return fromUserId == that.fromUserId && Objects.equals(type, that.type) && Objects.equals(fromUserName, that.fromUserName) && Objects.equals(reason, that.reason);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, fromUserId, fromUserName, reason);
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public int getFromUserId() {
        return fromUserId;
    }

    public void setFromUserId(int fromUserId) {
        this.fromUserId = fromUserId;
    }

    public String getFromUserName() {
        return fromUserName;
    }

    public void setFromUserName(String fromUserName) {
        this.fromUserName = fromUserName;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }
}
